package com.security.db.bootsecuritydb.service.impl;

import com.security.db.bootsecuritydb.domain.SecurityDO;
import com.security.db.bootsecuritydb.repository.SecurityRepository;
import com.security.db.bootsecuritydb.service.SecurityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Classname SecurityServiceImpl
 * @Description TODO
 * @Date 2020/4/21 0021 12:17
 * @Created by 埔枘
 */
@Service
public class SecurityServiceImpl implements SecurityService {

    @Autowired
    private SecurityRepository securityRepository;

    @Override
    public SecurityDO loginByUsername(String username) {
        SecurityDO securityDO = securityRepository.findByUsername(username);
        return securityDO;
    }

    @Override
    public SecurityDO saveUser(SecurityDO securityDO) {
        return securityRepository.save(securityDO);
    }
}
